package com.jsbj.user.controller;


import com.jsbj.base.ResultBean;
import com.jsbj.framework.controller.BaseController;
import com.jsbj.user.service.ISysFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 * 文件表 前端控制器
 * </p>
 *
 * @author jsbj
 * @since 2022-05-17
 */
@RestController
@RequestMapping("/sys-file")
@Api(value = "文件上传", tags = "文件上传")
@ApiIgnore
public class SysFileController extends BaseController {

    @Autowired
    private ISysFileService sysFileService;

    @ApiOperation(value = "上传文件")
    @PostMapping("/uploadFileFile")
    public ResultBean<Map<String, Object>> uploadFileFile(@RequestParam("uploadFile") MultipartFile uploadFile, HttpServletRequest request) {
        return new ResultBean<Map<String, Object>>(sysFileService.uploadFileByType(uploadFile, request));
    }

}

